/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
$(document).ready(function(){
    $("thead th").prepend("<span>+</span>").css("cursor", "pointer");
    $("table tr:nth-child(2n)").addClass("fundo");
    $("tr").hover(function(){
        $(this).addClass("efeito");
    }, function(){
        $(this).removeClass("efeito");
    });
    
    $("thead tr th").each(function(i){
        var n = i; 
        $(this).click(function(){
            $("td").removeClass("destaque");
            $(this).parents("thead")
                .siblings("tbody")
                .children("tr")
                .each(function(){
                     $(this).children("td:eq("+n+")").addClass("destaque");
                });
        });
    });
    
});